<template>
	<!-- 顶部导航栏 -->
	<view class="box cu-item">
		<view class="top-cont"></view>
		<view class="set flex justify-between padding-sm align-center">
			<text @click="handleback" style="font-size: 25px;" class="cuIcon-close"></text>
			<text style="font-size: 20px;">【{{tiltename}}】</text>
			<text style="font-size: 20px;">删除</text>
		</view>
	</view>
	<view class="text-center">

		<view v-for="(item) in wenList" class=" margin-top-lg">
			<custom-card :data="item"></custom-card>
		</view>
		<text class="text-gray margin-top-lg">---end---</text>

	</view>
</template>

<script setup lang="ts">
	import { onLoad } from '@dcloudio/uni-app';
	import http from '@/utils/http';
	import { ref, type Ref } from 'vue';
	import type { Post } from '@/model/goods';
	let wenList = ref<Post[]>([])
	let tiltename = ref<string>('')
	onLoad(async (option : any) => {
		console.log(option);
		tiltename.value = option.titlename
		let res = await http.get('classes/goods', {
			params: {
				where: option
			}
		})
		console.log(res.data.results);
		wenList.value = [...res.data.results]
	})
	//返回
	const handleback = () => {
		uni.navigateBack({
			delta: 1
		})
	}
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}

	.box {
		position: sticky;
		top: 0;
		z-index: 777;
		background-color: white;

		.top-cont {
			height: 35px;
		}
	}
</style>